<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/include/TLDInclude.jsp"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<%@ include file="/WEB-INF/include/meta.jsp"%>
<%@ include file="/WEB-INF/jsp/pageInclude.jsp"%>
<link href="${ctx}/css/select.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="${ctx}/js/select-ui.min.js"></script>
<title>用户列表</title>

<script type="text/javascript">
$(document).ready(function(){
  $(".click").click(function(){
  $(".tip").fadeIn(200);
  });
  
  $(".tiptop a").click(function(){
  $(".tip").fadeOut(200);
});

  $(".sure").click(function(){
  $(".tip").fadeOut(100);
});

  $(".cancel").click(function(){
  $(".tip").fadeOut(100);
});
  
  
     $(".select1").uedSelect({
		width : 345			  
	});
	$(".select2").uedSelect({
		width : 167  
	});
	$(".select3").uedSelect({
		width : 100
	});
  
  
  var page = "${pagebean.currentPage}";
  var totalResults = "${pagebean.totalResults}";
  var pageSize = "${pagebean.pageSize}";
  $("#pagination").pagination(totalResults, {items_per_page:pageSize,
	num_display_entries:5,
	num_edge_entries:1,
	current_page:page-1,
	prev_text: "上页",
	next_text: "下页",
callback:function(vpage){
	if((page-1) !=vpage){
		var name =  $("#name").val();
		var aid =  $("#select_aid").val();
		var lid =  $("#select_lid").val();
		
		window.location.href="${ctx}/luckuser"+"?page="+(vpage+1)+"&name="+name+"&aid="+aid+"&lid="+lid;
	}
	  }
	});
  
  
});


</script>


</head>


<body>

    
    <c:if test="${not empty msg}">
			<div id="message" style="color: red;" align="center">
				${msg}
			</div>
</c:if>
    
<c:if test="${empty msg}">
    
    <div class="rightinfo">
    
    <div class="tools">
    
    	<ul class="seachform">
      

 <form:form action="${ctx}/luckuser" method="post" id="findsubmit" >
 

 <li><label>选择活动</label>
     <div class="vocation">
<select id="select_aid" name="aid" class="select2" onchange="findData()">
<option value=0>请选活动</option>
    <c:forEach items= "${activitys}" var="maste">
    <option value="${maste.id}"
     <c:if test= "${aid eq maste.id}">
                                                         selected="selected "
                                                 </c:if>
    >${maste.name}</option>
    </c:forEach>
    </select>
</div>

 <li><label>选择奖品组</label>
     <div class="vocation">
<select id="select_lid" name="lid" class="select2" onchange="findData()">
<option value=0>请选奖品组</option>
    <c:forEach items= "${alevel}" var="maste">
    <option value="${maste.id}"
     <c:if test= "${lid eq maste.id}">
                                                         selected="selected "
                                                 </c:if>
    >${maste.levelName}</option>
    </c:forEach>
    </select>
</div>

 <li><label>用户名</label><input id="name" name="name" type="text" value="${name}" class="scinput" /></li>
    
    <li><label>&nbsp;</label><input type="submit" class="scbtn" value="查询"/></li>
    </form:form>
        </ul>
        
         
        <ul class="toolbar1">
          <li ><a href="${ctx}/luckuser/indeluser"><span><img src="${ctx}/images/t02.png" /></span>清理抽奖用户</a></li>
        
          <li ><a href="${ctx}/luckuser/upfile"><span><img src="${ctx}/images/t01.png" /></span>EXCEl用户上传</a></li>
       
        </ul>
    
    
    </div>


    <table class="tablelist">
    
    
    	<thead>
    	<tr>
        
        <th>编号</th>
        <th>活动名称</th>
         <th>用户名</th>
        <th>组别名称</th>
        <th>充值金额</th>
        <th>打码量</th>
        <th>可抽次数</th>
        <th>已抽次数</th>
        <th>是否限制</th>
        <th>操作人</th>
        <th>操作日间</th>
        <th>管理</th>
        </tr>
        </thead>
        
        
        
        
        
        <tbody>
        
         <c:forEach items= "${pagebean.data}" var="pagedata"  varStatus="status">
         
	        <tr>
	        <td>${status.index + 1}</td>
	         <td>${pagedata.activityName}</td>
	        <td>${pagedata.userName}</td>
	        <td>${pagedata.levelName}</td>
	         <td>${pagedata.money}</td>
	          <td>${pagedata.betMoney}</td>
	           <td>${pagedata.lotteryNum}</td>
	          
	         <td>${pagedata.useNum}</td>
	        <c:choose>
				<c:when test="${pagedata.userValid == 0}">
				 	<td>黑名单</td>
				</c:when>
				<c:when test="${pagedata.userValid == 1}">
					 <td>无限制</td>
				</c:when>
			</c:choose>
	        <td>${pagedata.operatorName}</td>
	         <td><fmt:formatDate value='${pagedata.lastTime}' pattern='yyyy-MM-dd HH:mm:ss'/></td>
	         
	        <td>    <a href="${ctx}/luckuser/delete?id=${pagedata.id}" onclick="javascript:return p_del()"  class="tablelink"> 删除</a> <a href="${ctx}/luckuser/instart?id=${pagedata.id}"   class="tablelink">切换奖品组</a> </td>
	        </tr> 
         </c:forEach>
        </tbody>
    </table>
    
    
    
    <div class="pagination" id="pagination">
    
    </div>
    
    
   
    <!-- <div class="pagin">
    	<div class="message">共<i class="blue">1256</i>条记录，当前显示第&nbsp;<i class="blue">2&nbsp;</i>页</div>
        <ul class="paginList">
        <li class="paginItem"><a href="javascript:;"><span class="pagepre"></span></a></li>
        <li class="paginItem"><a href="javascript:;">1</a></li>
        <li class="paginItem current"><a href="javascript:;">2</a></li>
        <li class="paginItem"><a href="javascript:;">3</a></li>
        <li class="paginItem"><a href="javascript:;">4</a></li>
        <li class="paginItem"><a href="javascript:;">5</a></li>
        <li class="paginItem more"><a href="javascript:;">...</a></li>
        <li class="paginItem"><a href="javascript:;">10</a></li>
        <li class="paginItem"><a href="javascript:;"><span class="pagenxt"></span></a></li>
        </ul>
    </div> -->
    
    
    <div class="tip">
    	<div class="tiptop"><span>提示信息</span><a></a></div>
        
      <div class="tipinfo">
        <span><img src="../images/ticon.png" /></span>
        <div class="tipright">
        <p>是否确认对信息的修改 ？</p>
        <cite>如果是请点击确定按钮 ，否则请点取消。</cite>
        </div>
        </div>
        
        <div class="tipbtn">
        <input name="" type="button"  class="sure" value="确定" />&nbsp;
        <input name="" type="button"  class="cancel" value="取消" />
        </div>
    
    </div>
    
    
    
    
    </div>
    
   </c:if>
</body>

</html>
